<template>
	<view>
		<view v-if="after_sale_list.length!==0" class="bac_f ml24 mr24 padding30 mt24" v-for="(item,index) in  after_sale_list" :key="index">
			<view class="dis_flex">
				<view class="tf_999 fz24">
					订单编号：{{item.order_no}}
				</view>
				<view class="fz24 tf_4537">
					退款/等待平台处理
				</view>
			</view>
			<view class="dis_f mt20">
				<view class="df">
					<image class="radius12" style="width: 128rpx;height: 128rpx;" :src="item.image" mode="aspectFill"></image>
					<view class="ml24">
						<view class="dis_f">
							<view class="fz26 fw" style="max-width: 350rpx;">
								{{item.name}}
							</view>
						</view>
						<view class="dis_f fz24 mt10 tf_999">
							<view class="">
								预约时间
							</view>
							<view class="ml20 tf_666">
								{{item.reserve_time[0]}}-{{item.reserve_time[1]}} {{item.reserve_time[2]}}
							</view>
						</view>
						<view class="dis_f fz24 mt10 tf_999">
							<view class="">
								支付金额 
							</view>
							<view class="ml20 tf_666">
								¥{{item.price}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="df je mt24">
				<view  class="w152 mr20 h56 dis_f jc border fz26 tf_33 radius8">
					联系客服
				</view>
				<view  class="w152 h56 dis_f jc border4537 fz26 tf_4537 radius8" @click="goDetail(item)">
					查看详情
				</view>
			</view>
		</view>
		<view v-if="after_sale_list.length==0" class="mt100"><u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty></view>
	</view>
</template>

<script>
	import {
		mineSaleAfter
	} from "@/config/api.js";
	export default {
		data() {
			return {
				after_sale_list:[],
			}
		},
		onLoad() {
			console.log(this.after_sale_list);
			this.mineSaleAfter()
		},
		methods: {
			//售后详情
			goDetail(e){
				uni.navigateTo({
					url:'../afterDetail/afterDetail?id='+e.aid
				})
			},
			//获取售后信息
			mineSaleAfter(){
				mineSaleAfter().then(res=>{
					console.log(res);
					res.forEach(v=>{
						v.reserve_time =v.reserve_time.split('+')
						v.reserve_time[1]=v.reserve_time[1].replace('/',"-")
					})
					this.after_sale_list =res
				})
			},
		}
	}
</script>

<style>

</style>
